﻿namespace Partner.Utility
{
    public class BaseBizResult
    {
        /// <summary>
        /// 接口调用是否成功
        /// </summary>
        public bool Success { get; set; }
        /// <summary>
        /// 返回的错误信息
        /// </summary>
        public string Message { get; set; }
        /// <summary>
        /// 不成功时的错误码(如果需要)
        /// </summary>
        public ErrorCodeEnum? ErrorCode { get; set; }
        /// <summary>
        /// 不成功时的数据(如果需要)
        /// </summary>
        public object ErrorData { get; set; }
    }

    public class BizResult<T> : BaseBizResult
    {
        /// <summary>
        /// 返回的数据（泛型）
        /// </summary>
        public T Data { get; set; }
    }

    /// <summary>
    /// 返回成功
    /// </summary>
    public class SuccessResult
    {
        /// <summary>
        /// 成功标识
        /// </summary>
        public bool Success { get => true; }
        /// <summary>
        /// 对象
        /// </summary>
        public object Data { get; set; }
    }
}
